<template>
  <div class="h-full">
    <DataScreenHeader title="生产管理计划看板" :showMonth="false" classes="" />
    <div
      style="
        height: calc(100% - 100px);
        padding: 10px 20px 20px;
        overflow: hidden;
      "
    >
      <dv-border-box10 class="overflow-hidden">
        <div dv-bg class="flex justify-center items-center m-[30px]">
          <ScrollTableDemo :planBIDTOS="planBIDTOS" />
        </div>
      </dv-border-box10>
    </div>
  </div>
</template>

<script setup lang="ts">
import { BorderBox10 as DvBorderBox10 } from "@kjgl77/datav-vue3";
defineOptions({
  name: "DATASCREENMES01",
  inheritAttrs: false,
});

const props = defineProps({
  planBIDTOS: {
    type: Array,
    default: () => [],
  },
  refreshRate: {
    type: Number,
    default: () => 0,
  },
});

const emit = defineEmits(["get-info"]);
const { planBIDTOS, refreshRate } = toRefs(props);

let timer: any = ref(null);

onMounted(() => {
  if (refreshRate.value) {
    timer.value = setInterval(() => {
      emit("get-info");
    }, refreshRate.value * 1000);
  }
});

onBeforeUnmount(() => {
  clearInterval(timer.value);
  timer.value = null;
});
</script>

<style lang="scss" scoped></style>
